import 'package:azlistview/azlistview.dart';
import 'package:library_base/entities/generated/json/base/json_field.dart';
import 'package:library_base/entities/generated/json/warehouse_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class WarehouseEntity extends ISuspensionBean {
  late String id;
  late String provinceId;
  late String cityId;
  late String areaId;
  late String villageId;
  late String addr;
  late String whCode;
  late String whName;
  late String contact;
  late String mobile;

  String? tagIndex;
  String? namePinyin;
  bool isSelect = false;

  WarehouseEntity();

  factory WarehouseEntity.fromJson(Map<String, dynamic> json) => $WarehouseEntityFromJson(json);

  Map<String, dynamic> toJson() => $WarehouseEntityToJson(this);

  @override
  String getSuspensionTag() => tagIndex!;

  @override
  String toString() => json.encode(this);

  @override
  bool operator ==(Object other) =>
      identical(this, other) ||
      other is WarehouseEntity && runtimeType == other.runtimeType && id == other.id;

  @override
  int get hashCode => id.hashCode;
}
